

<%@ page import="com.auctionhaus.Listing" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'listing.label', default: 'Listing')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <g:render template="/layouts/menuBar" />
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${listingInstance}">
            <div class="errors">
                <g:renderErrors bean="${listingInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${listingInstance?.id}" />
                <g:hiddenField name="version" value="${listingInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                            <div class="formField" align="right">
                              <label for="listName">List Name:</label>
                              <g:textField name="listName" value="${listingInstance?.listName}" />
                            </div>
                            <div class="formField" align="right">
                                 <g:formatDate date="${new Date()}" name="creationDate" value="${listingInstance?.creationDate}"/>
                            </div>
                            <div class="formField" align="right">
                                <label for="description">Description:</label>
                                <g:textField name="description" value="${listingInstance?.description}"/>
                            </div>
                            <div class="formField" align="right">
                                <label for="startBidPrice">Starting Bid Price:</label>
                                <g:textField name="startBidPrice" value="${listingInstance?.startBidPrice}"/>
                            </div>
                             <div class="formField" align="right">
                                <label for="seller.emailAddress">Seller's Email Address:</label>
                                <g:textField name="seller.emailAddress" value="${listingInstance?.seller?.emailAddress}"/>
                            </div>
                            <span class="formField" align="right">
                                <label for="endDateTime">End Date Time:</label>
                                <g:datePicker name="endDateTime" value="${listingInstance?.endDateTime}"/>
                            </span>

                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
